<!--  tambah kelas modal -->
<div class="modal fade" id="AddModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">Tambah Kelas Th. Ajaran <?php foreach ($list_th as $row) {echo $row->th_ajaran;}?></h4>
      </div>
      <div class="modal-body">
		<?php 
			echo form_open_multipart('atur_kelas/add_exe', array('class' => 'form-horizontal', 'role' => 'form')); 
		?>
		<input type="hidden" name="id_mr_th_ajaran" value="<?php echo $nis = $this->security->xss_clean($this->uri->segment(3));?>"/>
		<input type="hidden" name="id_lembaga" value="<?php echo $nis = $this->security->xss_clean($this->uri->segment(4));?>"/>					  
		
		<div class="form-group">
			<label class="col-sm-3 control-label label-elba">Kelas</label>
			<div class="col-sm-5">
				<select name="id_mr_kelas" class="form-control form-elba input-sm">
					<?php foreach ($list_kelas as $row_kelas){ ?>
						<option value="<?php echo $row_kelas->id_mr_kelas; ?>"><?php echo $row_kelas->kelas; ?></option>
					<?php } ?>
				</select>
			</div>
		</div>
		
		<div class="form-group">
			<label class="col-sm-3 control-label label-elba">Wali Kelas</label>
			<div class="col-sm-5">
				<select name="id_mr_pegawai" class="form-control form-elba input-sm">
					<?php 
						if(count($list_pegawai)>0){
							foreach ($list_pegawai as $row_p){ 
					?>
						<option value="<?php echo $row_p->id_mr_pegawai; ?>"><?php echo $row_p->nm_pegawai; ?></option>
					<?php 
							}
						}else{
					?>
						<option value="null">Belum ada data Wali Kelas</option>
					<?php
						}
					?>
				</select>
			</div>
		</div>
		
		<div class="modal-footer">
			<button type="submit" class="btn btn-default btn-sm" data-dismiss="modal">Batal</button>
			<?php if(count($list_pegawai)>0 && count($list_kelas)>0){?>
			<button type="submit" class="btn btn-primary btn-sm">Tambahkan</button>
			<?php }?>
		 </div>
	
		<?php 
			echo form_close();
		?>
      </div>      
    </div>
  </div>
</div>
<!-- end tambah kelas modal -->

<div id="page-wrapper">
    <!-- /.row -->
    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <span class="judul-page">Pengaturan Kelas Pada <?php foreach ($list_lembaga as $row) {echo $row->nama_lembaga;}?> Th. Ajaran <?php foreach ($list_th as $row) {$id_th = $row->id_mr_th_ajaran; echo $row->th_ajaran;}?></span>
					<span class="pull-right">
                        <a href="<?php echo site_url()?>atur_kelas/lembaga/<?php echo $id_th; ?>" class="btn btn-primary btn-xs"><span class="glyphicon glyphicon-arrow-left"></span>&nbsp;Kembali</a>
                        <a href="" class="btn btn-warning btn-xs" data-toggle="modal" data-target="#AddModal"><span class="glyphicon glyphicon-plus"></span>&nbsp;Tambah Kelas</a>
                    </span>
                    <div class="clearfix"></div>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                      <table class="table table-striped table-bordered table-hover">
                        <thead>
                            <tr>
                                <th width="50">#</th>
                                <th width="80">Kelas</th>
                                <th>Wali Kelas</th>
                            </tr>
                        </thead>
                        <tbody>
						<?php 
						if(count($list)>0){
							$i = 1; 
							foreach ($list as $row) {
						?>										
                            <tr>
                                <td><?php echo $i++ ?></td>
                                <td><?php echo $row->kelas; ?></td> 
                                <td><?php echo $row->nm_pegawai; ?>
                                	<span class="pull-right">
																		<a href="<?php echo site_url('bagi_pendamping/index/'.$row->id_atur_kelas);?>" class="btn btn-info btn-xs" title="Edit"><span class="glyphicon glyphicon-file"></span></a>
																		<a href="<?php echo site_url('atur_kelas/delete/'.$row->id_atur_kelas);?>" onclick="return confirm('Yakin Anda akan menghapus data Gaji ini secara permanen?')" class="btn btn-danger btn-xs" title="Hapus"><span class="glyphicon glyphicon-trash"></span></a>
																	</span>
																</td> 
                            </tr>
						<?php
							}
						}else{
						?>
							<tr>
                                <td colspan="3"><center>Belum ada kelas pada tahun ajaran ini.</center></td>
							</tr>
						<?php
						}
						?>
                        </tbody>
                      </table>
                    </div>
                    <div class="clearfix"></div>
                    <center>
                    <!--<ul class="pagination">
                      <li class="disabled"><a href="#"> << </a></li>

                      <li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>
                      <li><a href="#">2</a></li>
                      <li><a href="#">3</a></li>
                      <li><a href="#">4</a></li>

                      <li><a href="#"> >> </a></li>
                    </ul>-->
                    </center>
                </div>
            </div>
        </div>
    </div>
    <!-- /.row -->
</div>
<!-- /#page-wrapper -->